#!/usr/bin/perl
# $Id: conkyforecast 3 2006-09-24 08:08:44Z cmauch $
# Author: Charles Mauch (cmauch@gmail.com)
# Description: Weather Info for conky or whatever
# Legal: (c) 2006 Charles Mauch, released under the terms of the GPLv2 (or later)

# Possible argument values
#
# place
# temperature_celsius
# temperature_fahrenheit
# humidity
# conditions
# wind_direction
# wind_milesperhour
# wind_kilometersperhour
# pressure
# updated
# clouds
# dewpoint_celsius
# dewpoint_fahrenheit
# moonphase
# moonrise
# moonset
# sunrise
# sunset
# visibility_miles
# visibility_kilometers

use Weather::Underground;

$weather = Weather::Underground->new(
	place =>	   "98444",
	debug =>	   0,
	cache_file =>      "/tmp/weather.cache",
        cache_max_age =>   500
) || die "Error, could not create new weather object: $@\n";

$arrayref = $weather->get_weather() || die "Error, calling get_weather() failed: $@\n";

print "$arrayref->[0]->{$ARGV[0]}";
